package com.chii.gateway.admin.po;


public class ResponeInfo<T> {
    private Integer code = 200;
    private String msg = "SUCCESS";
    private T data;

    public ResponeInfo() {
    }

    public ResponeInfo(ResultCode resultEnum) {
        this.code = resultEnum.getCode();
        this.msg = resultEnum.getMessage();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void success(T data) {
        this.data = data;
        this.code = 200;
    }

    public void failure(String msg) {
        this.msg = msg;
        this.code = 0;
    }
}
